
<?php 

if (count($this->results) == 0){?>

<div class="noResults">No Results Are Found x_x</div>
<div class="dotline"></div>

<?php } else {

foreach ($this->results as $book) { 
	?>
    
    <li>
    <div class="bookImg">
    	<img src="<?php echo $this->bookThumbnail($book); ?>"/>
	</div>
	<div class="bookDesc">
    	<h2>
    	<a bid="<?php echo $book->ISBN;?>" href="<?php 
    	if($this->type == "myBooks" || $this->type == "bookList")
    		echo $this->url(array("controller"=>"book", "action"=>"detail", "id"=>$book->ISBN), "default", true);
    	if($this->type == "amazonList")
    		echo $this->url(array("controller"=>"book", "action"=>"add", "id"=>$book->ISBN), "default", true);
    		 
    		?>">
		<?php echo $book->name; ?></a></h2>
	<span><?php if (isset($book->author))echo 'by '.$book->author; ?>
	(<?php echo $book->binding.' - '.$book->publication_date;?>)</span>	
	
		<?php if(isset($this->user) && ($this->type == "myBooks" || $this->type == "bookList")) echo $this->userBookStatusView($book, $this->user);?>
		
	<?php if($this->type == "myBooks"){ //This is my books?>
	<div class="editThisOne">
	<a style="float:left;" href="<?php echo $this->url(array("controller"=>"book", "action"=>"edit", "id"=>$book->ISBN), "default", true);?>">Edit</a> 
	<div class="markAs" style="float:left;margin-left:7px;"> | Mark as 
	<?php if($this->status == "available") {?>
	<a href="javascript:void(0)" class="letout">Letout</a>, 
	<a href="javascript:void(0)" class="sold">Sold</a><?php }?>
	
	<?php if($this->status == "letout") {?>
	<a href="javascript:void(0)" class="available">Available</a>, 
	<a href="javascript:void(0)" class="sold">Sold</a><?php }?>
	
	<?php if($this->status == "sold") {?>
	<a href="javascript:void(0)" class="available">Available</a>, 
	<a href="javascript:void(0)" class="letout">Letout</a><?php }?>
	
	</div>
	</div>
	<?php }?>
</div>
    </li>
<div class="dotline"></div>
<?php }}
?>
</ul>